-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added custom search engine input #2088 #2134
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great and mostly looks good, just one spot that could probably be adjusted for safety
guake/callbacks.py
Outdated
|
||
selected = self.settings.general.get_int("search-engine") | ||
# if custom search is selected, get the engine from the 'custom-search-engine' setting | ||
if selected == 4: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check for the custom option should be checking to see if it's the last index. Hardcoding to 4 can generate unexpected bugs if the list of preset search engines changes length in the future.
guake/prefs.py
Outdated
self.get_widget("search_engine_select").set_active(value) | ||
# if 'Custom' is selected make the search engine input editable | ||
if value == 4: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar deal here
I can't find anyway to get the length of the ComboBox. Do you know of a method to do that? |
You can query the length of a combobox if you already have a pointer to it, but to my knowledge it's a bit ugly getting that when the combobox is nestled deep in a glade layout because there's no get element by id equivalent, but we also have the |
… Neeva search engine
Alright that's what I was thinking. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, merging. Thanks for the contributions!
Added input on the general menu to add a custom search engine.